from prettifyMarkdown import Formater

formater = Formater()


def test_isImage():
    assert (formater.isImage("![image - 2 0200806150650689](https://gitee.com/gsunwu/blogs/raw/master/blogs - images /20200806150657.png)"))
    assert (formater.isImage("我的![image - 2 0200806150650689](https://gitee.com/gsunwu/blogs/raw/master/blogs - images /20200806150657.png)"))
    assert (formater.isImage("我的![](https://gitee.com/gsunwu/blogs/raw/master/blogs - images /20200806150657.png)"))
    assert (not formater.isImage("我的(https://gitee.com/gsunwu/blogs/raw/master/blogs - images /20200806150657.png)"))
def test_isCodeBlock():
    assert (formater.isCodeBlock('```'))
    assert (not formater.isCodeBlock("``"))
    assert (not formater.isCodeBlock("---"))
def test_line():
    assert (str(formater.formateLine("费利蒙		 旧金山		 44\n")).find("\n")>-1)
    assert (str(formater.formateLine("熟悉Scala语言，基于Spark 思想，编写SparkWordCount程序")).find("SparkWordCount")==27)